<!DOCTYPE html>
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<html>
<head>
<title>${name_china}管理列表</title>
<%@include file="/common/head.jsp" %>

</head>
<body class="iframe-page">
<div class="page-title-wrapper">
    <div class="page-title">
        <div class="page-title-text">
            <span>${name_china}管理</span>
        </div>
        <div id="toolbar" style="float: right"></div>
        <a id="goBack" class="btn-return distance-left" href="javascript:;"><i class="icon icon-arrow-left"></i>返回上级</a>
    </div>
    <div class="page-title-border"></div>
</div>

<div class="search-field">
    <span class="field-cont">
        <span class="field-cont-title" style="color:red;">请使用UC浏览器打开</span>
        <a href="http://sw.bos.baidu.com/sw-search-sp/software/1f8d62f0b49a7/Browser_6.2.3964.2_4691_setup.exe">点击下载UC浏览器</a>
    </span>
    <span class="field-cont">
        <span class="field-cont-title">用户ID</span>
        <input type="text" class="summer-input" id="id"/>
        <input type="hidden" class="summer-input" id="payLogId"/>
    </span>
    <span class="field-cont">
        <span class="field-cont-title">用户名</span>
        <input type="text" class="summer-input" id="userNickName"/>
    </span>
    <span class="field-cont">
        <span class="field-cont-title">用户电话</span>
        <input type="text" class="summer-input" id="userPhone"/>
    </span>
    <span class="field-cont">
        <span class="field-cont-title">提现类型</span>
        <input type="text" class="summer-input" id="payType"/>
    </span>
    <span class="field-cont">
        <span class="field-cont-title">提现状态</span>
        <input type="text" class="summer-input" id="withdrawState"/>
    </span>
    <span class="field-btn-wrapper">
        <a id="search" class="btn btn-primary btn-icon wave distance-right"><i class="icon icon-search"></i></a>
        <a id="reset" class="btn btn-icon wave wave-dark"><i class="icon icon-refresh"></i></a><br/>
    </span>
    
</div>
<div>
</div>
<div id="t-wrap">
    <table class="summer-datagrid" id="dataList">
	    <col width="20%">
	    <col width="20%">
	    <col width="20%">
	    <col width="24%">
	    <col width="10%">
	    <col width="20%">
	    <col width="20%">
	    <col width="20%">
	    <col width="20%">
	    <col width="30%">
	    <thead>
		    <tr>
		        <th>提现类型</th>
		        <th>昵称/ID</th>
		        <th>账户姓名</th>
		        <th>手机号</th>
		        <th>金额</th>
		        <th>提现日期</th>
		        <th>到账日期</th>
		        <th>状态</th>
		        <th>是否发放</th>
		        <th>备注</th>
		    </tr>
	    </thead>
    </table>
</div>

<script>
	//请求url
	var CONST_URL = {
		LIST: basePath + '${common_url}list',
	   	INIT_ADD: basePath + "${common_url}initAdd",
	   	INIT_EDIT: basePath + "${common_url}initEdit",
	   	INIT_VIEW: basePath + "${common_url}initView",
	   	DEL: basePath + "${common_url}del",
	   	CHECK_STATE: basePath + "${common_url}checkState",
	   	CHECK_WX: basePath + "${common_url}checkWx",
	   	INIT_MAIN: basePath + "${common_url}init"
	};
	
    var  permission = CommonUtil.getPermission('${name_english}');
    
    $(function () {
    	$("#payLogId").val(${payLogId});
    	//返回按钮
    	$('#goBack').on('click',backMain);
    	//checkWx
    	$.funcbar({
			id: 'toolbar',
			type: 'toolbar',
			data: permission,
			permit: ['${name_english}:checkWx']
		});
    	//初始化下拉选项
    	   $('#payType').combobox({
            valueField : 'code',
            textField : 'name',
            url : COMMON_URL.getCode + '?type=T_DM_T_PAY_USER_LOG_PAY_TYPE'
        });
    	 //初始化下拉选项
       	   $('#withdrawState').combobox({
               valueField : 'code',
               textField : 'name',
               url : COMMON_URL.getCode + '?type=T_DM_T_PAY_USER_LOG_WITHDRAW_STATE'
           });
    	// 查询按钮
        $('#search').on('click', reloadTable);
        
        //重置按钮
        $('#reset').on('click', function () {
        	//重置文本框的值
        	$('#subject').val('');
        	$('#payType').combobox('clear');
        	$('#withdrawState').combobox('clear')        	
        	reloadTable();
        });
        
       createTable();
        
    });
    
    // 重新加载表格
	function reloadTable() {
		$('#dataList').datagrid('reload',{
            ajax: {
            	param: {
            		"id": trimSpace($('#id').val()),
            		"userNickName": trimSpace($('#userNickName').val()),
            		"userPhone": trimSpace($('#userPhone').val()),
            		"payType":$('#payType').combobox('getValue'),
            		"withdrawState":$('#withdrawState').combobox('getValue'),
            		"payLogId": $("#payLogId").val()
            	}
            }
        });
	}
   
	//创建表格
    function createTable() {
    	$('#dataList').datagrid({
    		ajax: {
    			url: CONST_URL.CHECK_WX,
    			param: {
    				"id": trimSpace($('#id').val()),
            		"userNickName": trimSpace($('#userNickName').val()),
            		"userPhone": trimSpace($('#userPhone').val()),
            		"payType":$('#payType').combobox('getValue'),
            		"withdrawState":$('#withdrawState').combobox('getValue'),
            		"payLogId": $("#payLogId").val()
            	}
    		},
    		columns: [
    		     
    		     {
    		    	 field: 'type'
    		     },
    		     {
    		    	 field:'userNickName'
    		     },
    		     {
    		    	 field:'withdrawAccountName'
    		     },
    		     {
    		    	 field: 'userPhone'
    		     },
    		     {
    		    	 field: 'money'
    		     },
    		     {
    		    	 field: 'withdrawTime'
    		     },
    		     {
    		    	 field: 'successTime'
    		     },
    		     {
    		    	 field: 'state'
    		     },
    		     {
    		    	 field: 'isSend'
    		     },
    		     {
    		    	 field: 'failReason'
    		     }
    	    ]
    	});
    } 
  //返回主页面
    function backMain() {
    	window.location.href = CONST_URL.INIT_MAIN;
    }
</script>
</body>
</html>